import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";

const routes: Array<RouteRecordRaw> = [
  {
    path: "/class",
    name: "class",
    component: () => import("../views/ClassView.vue"),
    children: [
      {
        path: "/",
        name: "home",
        component: () => import("../views/HomeView.vue"),
        meta: {
          title: "首页",
        },
      },
      {
        path: "/flathunting",
        name: "flathunting",
        component: () => import("../views/FlatHunting.vue"),
        meta: {
          title: "找房",
        },
      },
      {
        path: "/issue",
        name: "issue",
        component: () => import("../views/IssueView.vue"),
        meta: {
          title: "发布",
        },
      },
      {
        path: "/information",
        name: "information",
        component: () => import("../views/InforMation.vue"),
        meta: {
          title: "消息",
        },
      },
      {
        path: "/my",
        name: "my",
        component: () => import("../views/MyView.vue"),
        meta: {
          title: "我的",
        },
      },
    ],
  },
  {
    path: "/login",
    name: "login",
    component: () => import("../views/LoginView.vue"),
    meta: {
      title: "登录",
    },
  },
];

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes,
});

export default router;
